﻿


Public Class Protection
    'Shared :
    Public Shared Defaults As Protection
    Shared Sub New()
        Defaults = New Protection
    End Sub
    'Ctor :
    Public Sub New()
        Me.Reset()
    End Sub
    'Fields :
    Public Property Encryption As Zip.EncryptionAlgorithm
    Public Property Password As String
    'Routines :
    Public Sub Reset()
        Me.Encryption = Zip.EncryptionAlgorithm.None
        Me.Password = Nothing
    End Sub
    Public Sub CopyFrom(ByVal prot As Protection)
        Me.Encryption = prot.Encryption
        Me.Password = prot.Password
    End Sub
    Public Sub ApplyToZip(ByVal zip As Zip.ZipFile)
        zip.Encryption = Me.Encryption
        zip.Password = Me.Password
    End Sub
    Public Function Infos() As String
        Return String.Format("Protection : {0}", Me.Encryption.InfosString)
    End Function
End Class